﻿using System;
using System.Windows.Data;
using MouseExtender.Logic.Enums;
using MouseExtender.Logic.Managers;

namespace MouseExtender.Logic.Converters
{
	class PeriodConverter : IValueConverter
	{
		#region IValueConverter Members

		public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
		{
			CheckUpdatesPeriod enumValue = (CheckUpdatesPeriod)(int)(double)value;
			string enumResourceKey = String.Format("{0}_{1}",Constants.ResourceKeys.Enums_CheckUpdatesPeriodKey, enumValue);
			string text = ResourceManager.GetUIResourceString(enumResourceKey);
			return text;
		}

		public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
		{
			throw new NotImplementedException();
		}

		#endregion
	}
}
